﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FS_Config
{
    /// <summary>
    /// Interaction logic for YfmCommandPanel.xaml
    /// </summary>
    public partial class YfmCommandPanel : UserControl
    {
        public YfmCommandPanel()
        {
            InitializeComponent();
        }

        public string GroupName
        {
            get { return (string)GetValue(GroupNameProperty); }
            set { SetValue(GroupNameProperty, value); }
        }

        public static readonly DependencyProperty GroupNameProperty =
                DependencyProperty.Register("GroupName", typeof(string),
                typeof(YfmCommandPanel));

        public string LightOnUri
        {
            get { return (string)GetValue(LightOnUriProperty); }
            set { SetValue(LightOnUriProperty, value); }
        }

        public static readonly DependencyProperty LightOnUriProperty =
                DependencyProperty.Register("LightOnUri", typeof(string),
                typeof(YfmCommandPanel));

        public string LightOffUri
        {
            get { return (string)GetValue(LightOffUriProperty); }
            set { SetValue(LightOffUriProperty, value); }
        }

        public static readonly DependencyProperty LightOffUriProperty =
                DependencyProperty.Register("LightOffUri", typeof(string),
                typeof(YfmCommandPanel));

        public string FlickWarnUri
        {
            get { return (string)GetValue(FlickWarnUriUriProperty); }
            set { SetValue(FlickWarnUriUriProperty, value); }
        }

        public static readonly DependencyProperty FlickWarnUriUriProperty =
                DependencyProperty.Register("FlickWarnUriUri", typeof(string),
                typeof(YfmCommandPanel));

        public event EventHandler<EventArgs> LightOnButtonClicked;
        public event EventHandler<EventArgs> LightOffButtonClicked;
        public event EventHandler<EventArgs> FlickWarnButtonClicked;

        private void yfmLightOnButton_Click(object sender, RoutedEventArgs e)
        {
            if (LightOnButtonClicked != null)
                LightOnButtonClicked(this, e);
        }

        private void yfmLightOffButton_Click(object sender, RoutedEventArgs e)
        {
            if (LightOffButtonClicked != null)
                LightOffButtonClicked(this, e);
        }

        private void yfmFlickWarnButton_Click(object sender, RoutedEventArgs e)
        {
            if (FlickWarnButtonClicked != null)
                FlickWarnButtonClicked(this, e);
        }
    }
}
